package com.example;

import com.example.annotation.FieldAnnotation;
import com.example.annotation.MethodAnnotation;

public class AnnotationModel {
    @FieldAnnotation(valueStr = "zrt")
    private String name;
    @FieldAnnotation(valueBool = true)
    private boolean isMan;
    @FieldAnnotation(valueInt = 22)
    private int age;
    private String remark;

    public AnnotationModel(){
        AnnotationManager.initFieldAnnotation(this);
        AnnotationManager.initMethodAnnotation(this);
    }

    @MethodAnnotation(value = "张润涛")
    public void sayHello(String param){
        System.err.println(String.format("hello, i'm %s",param));
    }

    public void sayHello(String param,int age){
        System.err.println(String.format("hello, i'm %s, i %s",param,age));
    }

    @Override
    public String toString() {
        return AnnotationModel.class +
                " >> " + name +
                " >> " + isMan +
                " >> " + age +
                " >> " + remark;
    }
}
